package org.dei.perla.parser.datastructures;

import org.dei.perla.parser.clauses.RefreshClause;
import org.dei.perla.parser.expressions.ConstantString;

public class Context extends DataStructure{
	
	private RefreshClause refresh;		
	private ConstantString validWhen;
	private ConstantString onEnable;
	private ConstantString onDisable;
	
	public RefreshClause getRefresh() {
		return this.refresh;
	}

	public void setRefresh(RefreshClause refresh) {
		this.refresh = refresh;
	}
	
	public ConstantString getValidWhenStm() {
		return this.validWhen;
	}

	public void setValidWhenStm(ConstantString validWhen) {
		this.validWhen = validWhen;
	}
	
	public ConstantString getOnEnableStm() {
		return this.onEnable;
	}

	public void setOnEnableStm(ConstantString onEnable) {
		this.onEnable = onEnable;
	}
	public ConstantString getOnDisableStm() {
		return this.onDisable;
	}

	public void setOnDisableStm(ConstantString onDisable) {
		this.onDisable = onDisable;
	}

	public String toString() {
		String stringToReturn = "Context VALID WHEN";		
		stringToReturn += this.getValidWhenStm();
		stringToReturn += " ON ENABLE ";
		stringToReturn += this.getValidWhenStm();
		if(this.getOnDisableStm()!=null) {
			stringToReturn += " ON DISABLE ";
			stringToReturn += this.getValidWhenStm();				
		}
		if(this.getRefresh() != null)
			stringToReturn += this.getRefresh().toString();
		return stringToReturn;
	}

}
